package org.akomantoso.core.io.util.group;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import org.akomantoso.core.data.A;
import org.akomantoso.core.data.B;
import org.akomantoso.core.data.I;
import org.akomantoso.core.data.Span;
import org.akomantoso.core.data.Sub;
import org.akomantoso.core.data.Sup;
import org.akomantoso.core.data.U;
import org.akomantoso.core.data.group.HTMLinline;
import org.akomantoso.core.io.util.Instantiator;

/**
 * @author <a href="mailto:jacques.militello@gmail.com">Jacques Militello</a>
 */
public final class HTMLinlineGroup {

	private HTMLinlineGroup() {
	}

	public static final Map<String, Instantiator<HTMLinline>> MAP;

	static {

		Map<String, Instantiator<HTMLinline>> temp = new HashMap<String, Instantiator<HTMLinline>>();
		
		// b
		temp.put(B.ELEMENT, new Instantiator<HTMLinline>() {
			public HTMLinline instantiate() {
				return new B();
			}
		});

		// i
		temp.put(I.ELEMENT, new Instantiator<HTMLinline>() {
			public HTMLinline instantiate() {
				return new I();
			}
		});

		// a
		temp.put(A.ELEMENT, new Instantiator<HTMLinline>() {
			public HTMLinline instantiate() {
				return new A();
			}
		});

		// u
		temp.put(U.ELEMENT, new Instantiator<HTMLinline>() {
			public HTMLinline instantiate() {
				return new U();
			}
		});

		// sub
		temp.put(Sub.ELEMENT, new Instantiator<HTMLinline>() {
			public HTMLinline instantiate() {
				return new Sub();
			}
		});

		// sup
		temp.put(Sup.ELEMENT, new Instantiator<HTMLinline>() {
			public HTMLinline instantiate() {
				return new Sup();
			}
		});

		// span
		temp.put(Span.ELEMENT, new Instantiator<HTMLinline>() {
			public HTMLinline instantiate() {
				return new Span();
			}
		});

		
		MAP = Collections.unmodifiableMap(temp);
	}
}
